package package01;

public class Transport {
    // 基本属性
    protected String name;    // 名称
    protected double speed;   // 速度（km/h）
    public Transport(String name, double speed) {
        this.name = name;
        this.speed = speed;
    }
    public void showMoveWay() {
        System.out.println(name + "正在以" + speed + "km/h的速度移动");
    }
    public void showProperties() {
        System.out.println("交通工具：" + name);
        System.out.println("速度：" + speed + "km/h");
    }
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getSpeed() {
        return speed;
    }

    public void setSpeed(double speed) {
        this.speed = speed;
    }
}


